﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Linq;
using System.Text;
using Snowdreamist.ComponentModel.Plugin;
using Snowdreamist.Runtime.Services;

namespace Snowdreamist.ComponentModel.MEF
{
    public class MEFCompositionService : IComposition
    {
        public MEFCompositionService(ExportProvider exportProvider)
        {
            if (exportProvider == null)
                throw new ArgumentNullException("exportProvider");
            if (exportProvider is CompositionContainer)
                this.Container = exportProvider as CompositionContainer;
            else
                this.Container = new CompositionContainer(exportProvider);
        }

        public CompositionContainer Container { get; private set; }

        public virtual void Initialize() { }

        public virtual void OnRuntimeDisposing() { }

        public object Compose(string contractName)
        {
            throw new NotImplementedException();
        }

        public T Compose<T>()
        {
            throw new NotImplementedException();
        }

        public T Compose<T>(string name)
        {
            throw new NotImplementedException();
        }
    }
}